package org.kotboot.domain;

import com.alibaba.fastjson.annotation.JSONField;
import org.kotboot.domainext.ExtAll;
import org.kotboot.enums.ESkuState;
import org.kotboot.kit.K;

import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * jisong.sun 2017/9/21 16:02
 */
@Table(name = "ms_sku")
public class Sku extends ExtAll {
    private Long commdity_id;
    private String sku_code;
    private String imgs;
    private int stock;
    private BigDecimal nprice;
    private BigDecimal oprice;
    private int bookmark;
    private String dimension;
    @JSONField(serialize = false)
    private ESkuState state;//` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1-上架,10-下架',

    public String getStatus(){
        return K.toStr(state);
    }
    public void setStatus(String val){
        this.state = ESkuState.of(val);
    }

    public Long getCommdity_id() {
        return commdity_id;
    }

    public void setCommdity_id(Long commdity_id) {
        this.commdity_id = commdity_id;
    }

    public String getSku_code() {
        return sku_code;
    }

    public void setSku_code(String sku_code) {
        this.sku_code = sku_code;
    }

    public String getImgs() {
        return imgs;
    }

    public void setImgs(String imgs) {
        this.imgs = imgs;
    }

    public int getStock() {
        return stock;
    }

    public void setStock(int stock) {
        this.stock = stock;
    }

    public BigDecimal getNprice() {
        return nprice;
    }

    public void setNprice(BigDecimal nprice) {
        this.nprice = nprice;
    }

    public BigDecimal getOprice() {
        return oprice;
    }

    public void setOprice(BigDecimal oprice) {
        this.oprice = oprice;
    }

    public int getBookmark() {
        return bookmark;
    }

    public void setBookmark(int bookmark) {
        this.bookmark = bookmark;
    }

    public String getDimension() {
        return dimension;
    }

    public void setDimension(String dimension) {
        this.dimension = dimension;
    }

    public ESkuState getState() {
        return state;
    }

    public void setState(ESkuState state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return K.toJson(this);
    }
}
